package com.misty.dao.dto;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import java.util.List;

@Data
@TableName(value = "users")
public class UsersDto {

    @TableId(type = IdType.AUTO)
    private Integer id; //用户id

    @NotBlank(message = "请输入账户名！")
    private String username;  //用户昵称

    @JsonIgnore
    @NotBlank(message = "请输入密码！")
    private String password; //用户密码

    @Email
    private String email;   //邮箱

    private String sex;     //性别

    private String avatar; //头像

    private Integer age;   //年龄

    private Boolean enabled = true; //状态

    private String address;  //地址

    @TableField(exist = false)
    private String token;

    @TableField(exist = false)
    private  List<String> roles;   //角色



}

